package cn.sxt.common.util;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;


import cn.sxt.common.util.ConstantFinalUtil;

public class BaseTest {

	protected ApplicationContext ac ;
	
	@Before
	public void init(){
		ac = new ClassPathXmlApplicationContext("classpath:spring/applicationContext_*.xml");
		ConstantFinalUtil.LOGGER.info("--------init-------");
	}
	@Test
	public void test(){
		ConstantFinalUtil.LOGGER.info("--------test-------");
	}
	@After
	public void close(){
		if(ac instanceof ClassPathXmlApplicationContext){
			ClassPathXmlApplicationContext cpxac = (ClassPathXmlApplicationContext) this.ac;
			cpxac.close();
		}
		ConstantFinalUtil.LOGGER.info("--------close-------");
	}
}
